<?php $this->header(); ?>
<div class="wrap">

    <!-- start -->
    <div class="nav">
        <ul class="cc">
            <li ><a href="/?g=Admin&m=Model&a=index">模型列表</a></li>
            <li class="current"><a href="/?g=Admin&m=Model&a=field&model_id=<?php echo $_GET['model_id']; ?>">字段列表</a></li>
            <li><a href="/?g=Admin&m=Model&a=addField&model_id=<?php echo $_GET['model_id']; ?>">添加字段</a></li>
        </ul>
    </div>
    <div class="table_list">
        <table width="100%" id="J_table_list" style="table-layout:fixed;">
            <colgroup>
                <col width="30">
                <col width="150">
                <col width="150">
                <col width="150">
                <col width="150">
                <col width="150">
                <col width="150">
                <col width="150">
            </colgroup>
            <thead>
                <tr>
                    <td></td>
                    <td>字段名称</td>
                    <td>字段值名</td>
                    <td>字段类型</td>
                    <td title="指的是HTML标签">是否过滤</td>
                    <td>必填</td>
                    <td>状态</td>
                    <td>操作</td>
                </tr>
            </thead>
            <?php foreach ($list as $key => $value): ?>
                <tr>
                    <td><span class="away_icon"></span></td>
                    <td>
                        <?php echo $value['name'] ?>
                    </td>
                    <td>
                        <?php echo $value['field_name']; ?>
                    </td>
                    <td>
                        <?php echo $func->fieldType($value['type']); ?>
                    </td>
                    <td>
                        <?php echo $value['htmlentities'] == 0 ? '<font color="blue">是</font>' : '<font color="red">否</font>'; ?>
                    </td>
                    <td>
                        <?php echo $value['required'] == 1 ? '<font color="blue">是</font>' : '<font color="red">否</font>'; ?>
                    </td>
                    <td>
                        <?php echo $func->status($value['status']); ?>
                    </td>

                    <td>
                        <a href="/?g=Admin&m=Model&a=editField&model_id=<?php echo $_GET['model_id']; ?>&id=<?php echo $value['id']; ?>" class="mr10 btn btn_submit"  title="编辑">编辑</a>
                        <a href="/?g=Admin&m=Model&a=deleteField&model_id=<?php echo $_GET['model_id']; ?>&id=<?php echo $value['id']; ?>" onclick="return deleteWarning(this)" class="mr10 btn btn_submit">删除</a>
                    </td>
                </tr>
            <?php endforeach; ?>
        </table>

    </div>

    <!-- end -->

</div>

<?php $this->footer(); ?>